fermat's little theorem solved problems